/*
 * @Author: your name
 * @Date: 2020-08-24 14:36:44
 * @LastEditTime: 2020-08-28 16:27:31
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \exam\react-exam\src\service\manager.ts
 */
import request from '../utils/request';

import { AddClassItem} from '../utils/interface';

/* 获取所有教室 */
export let getRoomList=()=>{
    return request.get('/manger/room');
}

/* 添加教室 */
export let addRoom=(room_text:string)=>{
    return request.post('/manger/room',{room_text});
}

/* 删除教室 */
export let delRoom=(room_id:string)=>{
    return request.delete('/manger/room/delete',{data:{room_id}});
}

/* 获取已经分配教室的班级的接口 */
export let getAllRoomList=()=>{
    return request.get('/manger/grade');
}

/* 获取没有分配教室的班级 */
export let getNoRoomList=()=>{
    return request.get('/manger/grade/new');
}

/* 添加班级信息 */
export let addClassManager=(params:AddClassItem)=>{
    return request.post('/manger/grade',params);
}

/* 修改班级信息 */
export let classManagerUpdate=(grade_id:string,grade_name?:string,subject_id?:string,room_id?:string)=>{
    return request.put('/manger/grade/update',{grade_id,grade_name,subject_id,room_id});
}

/* 删除班级 */
export let delAllRoomListItem=(grade_id:string)=>{
    return request.delete('/manger/grade/delete',{data:{grade_id}});
}
/* 已分配学生 */
export let allocatedList=()=>{
    return request.get('/manger/student');
}